home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 6 (Reseller Edition) / Apple Ref. & Pres. Lib.v6.0.toast / pc / 3-Presentations / Apple Demos / Training / HyperCard 2.0 Training / •HC 2.0-4 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1990-04-06  |  4.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.0-4</name>
  5.     <id>-1</id>
  6.     <cardCount>34</cardCount>
  7.     <cardID>13805</cardID>
  8.     <listID>19931</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- ================ Apple Training Support =================
  17. --
  18. -- Project Name: HyperCard 2.0 Product Training
  19. --
  20. -- Apple employees:
  21. -- Design and Development: Jeff Brechlin
  22. -- Team Leader: Mary VanRiper
  23. --
  24. -- Contractors:
  25. -- Design/Animations: Anne Wysocki
  26. -- Programmers: Gabriel Acosta, Kristi Wachter, Anne Wysocki
  27. -- Last modified: April 6, 1990
  28. -- ========================================================
  29.  
  30.  
  31. on closeBackground
  32. hide fld "Feedback"
  33. pass closeBackground
  34. end closeBackground
  35.  
  36.  
  37. -- This handler dehilites the buttons and hides the feedback on cds.
  38. on resetCd
  39. dehiliteBtns
  40. hideFeedback
  41. end resetCd
  42.  
  43. -- This GoNext handler hides the feedback fld if it's empty.
  44. on goNext
  45. lock screen
  46. hide fld "feedback"
  47. go next
  48. if fld "feedback" is not empty then show fld "feedback"
  49. unlock screen with wipe left
  50. end goNext
  51.  
  52. -- This GoPrev handler hides the feedback fld if it's empty.
  53. on goPrev
  54. lock screen
  55. hide fld "feedback"
  56. go prev
  57. if fld "feedback" is not empty then show fld "feedback"
  58. unlock screen with wipe right
  59. end goPrev
  60.  
  61. --=========  CHECK ANSWERS
  62. -- This handler checks the user's answer on cards that have
  63. -- a single answer.  It shows feedback using "whichIsHilited",
  64. -- "noAns", and "ans", all found in this stack script.
  65. on checkOneRight cdOrBg
  66. hide fld "feedback"
  67. put whichIsHilited() into choice
  68. if choice is "none" then
  69. noAns cdOrBg
  70. else
  71. ans choice,cdOrBg
  72. end if
  73. end checkOneRight
  74.  
  75. -- This handler checks the user's answer on cards that have
  76. -- more than one answer.  It shows feedback using "noAns" and "ans",
  77. -- which are found in this stack script.
  78. on checkManyRight cdOrBg
  79. put empty into choices
  80. repeat with i=1 to number of cd btns-2
  81. if the hilite of btn ("choice" & i) is true then
  82. put i after choices
  83. end if
  84. end repeat
  85. if choices is fld "answer" then ans 1,cdOrBg
  86. else if length(choices) = 0 then noAns cdOrBg
  87. else if length(choices) = 1 then ans 2,cdOrBg
  88. else ans 3,cdOrBg
  89. end checkManyRight
  90.  
  91.  
  92. --=========  RESET BUTTONS
  93. -- This handler resets draggable buttons to their original locations.
  94. on resetBtns
  95. repeat with i = 1 to number of cd btns
  96. moveBtnBack i
  97. end repeat
  98. end resetBtns
  99.  
  100. -- This handler reset a single draggable btn to its original location.
  101. on moveBtnBack i
  102. set the loc of btn i to line i of cd fld "theLocs"
  103. end moveBtnBack
  104.  
  105. --=========  BUTTON HILITES
  106. -- This handler returns the number of the hilited button.  If no
  107. -- button is hilited, it returns "none".
  108. function whichIsHilited
  109. repeat with i=1 to number of cd btns
  110. if the hilite of btn i is true then
  111. return i
  112. end if
  113. end repeat
  114. return "none"
  115. end whichIsHilited
  116.  
  117. -- This handler dehilites all btns, then hilites the target.
  118. -- Used for groups of radio buttons.
  119. on HiliteRadio
  120. dehiliteBtns
  121. set the hilite of the target to true
  122. end HiliteRadio
  123.  
  124. -- This handler dehilites all btns.
  125. on dehiliteBtns
  126. repeat with i = 1 to number of cd btns
  127. set the hilite of cd btn i to false
  128. end repeat
  129. end dehiliteBtns
  130.  
  131. --=========  FEEDBACK
  132. -- This handler shows feedback when the user presses the "Done" button
  133. -- before choosing an answer.  The "cdOrBg" argument handles cds that
  134. -- must show feedback in the cd layer (because of cd-layer graphics).
  135. on noAns cdOrBg
  136. lock screen
  137. if cdOrBg contains "c" then
  138. put "Please select an answer first." into cd fld "feedback"
  139. show cd fld "Feedback"
  140. else
  141. put "Please select an answer first." into fld "feedback"
  142. show fld "Feedback"
  143. end if
  144. unlock screen with wipe right
  145. end noAns
  146.  
  147. -- This handler gives feedback  The "cdOrBg" argument handles cds that
  148. -- must show feedback in the cd layer (because of cd-layer graphics).
  149. on ans num,cdOrBg
  150. lock screen
  151. if cdOrBg contains "c" then
  152. put line num of fld "AllFeed" into cd fld "feedback"
  153. show cd fld "feedback"
  154. else
  155. put line